home *** CD-ROM | disk | FTP | other *** search
/ Aminet 21 / Aminet 21 (1997)(GTI - Schatztruhe)[!][Oct 1997].iso / Aminet / dev / misc / gms_dev.lha / GMS / Includes / clib / games_protos.h
Encoding:
C/C++ Source or Header  |  1997-07-05  |  8.8 KB  |  274 lines

  1. #ifndef  CLIB_GAMES_PROTOS_H
  2. #define  CLIB_GAMES_PROTOS_H
  3.  
  4. /*
  5. **   $VER: games_protos.h V0.7B
  6. **
  7. **   C prototypes.
  8. **
  9. **   (C) Copyright 1996-1997 DreamWorld Productions.
  10. **       All Rights Reserved.
  11. */
  12.  
  13. #ifndef  GAMES_GMS_H
  14. #include <games/games.h>
  15. #endif
  16.  
  17. #ifndef  EXEC_TYPES_H
  18. #include <exec/types.h>
  19. #endif
  20.  
  21. #ifndef  EXEC_TASKS_H
  22. #include <exec/tasks.h>
  23. #endif
  24.  
  25. /************************************************************************************
  26. ** Kernal Functions
  27. */
  28.  
  29. LONG  OpenGPI(WORD ID);
  30. LONG  CloseGPI(WORD ID);
  31. LONG  SetUserPrefs(char *PrefsName);
  32. void  CloseGMS(void);
  33. void  AddInputHandler(void);
  34. void  RemInputHandler(void);
  35. void  AddInterrupt(APTR Interrupt, WORD IntNum, WORD IntPri);
  36. void  RemInterrupt(APTR IntBase);
  37. APTR  AllocMemBlock(LONG Size, LONG MemType);
  38. void  FreeMemBlock(APTR MemBlock);
  39. LONG  AddTrack(LONG Resource, LONG Data, void *Routine);
  40. void  DeleteTrack(LONG Key);
  41. struct GMSTask * FindGMSTask();
  42. void  GMSForbid(void);
  43. void  GMSPermit(void);
  44. LONG  GetMemSize(APTR MemBlock);
  45. LONG  GetMemType(APTR MemBlock);
  46.  
  47. LONG RemapGPI(LONG GPI, APTR Functions);
  48.  
  49. /************************************************************************************
  50. ** Standard functions
  51. */
  52.  
  53. LONG InitTags(APTR Structure, APTR TagList);
  54. LONG FastRandom(LONG Range);
  55. LONG SlowRandom(LONG Range);
  56. APTR WriteDec(LONG Number, LONG AmtDigits, char *Destination);
  57. APTR WriteHex(LONG Number, LONG AmtDigits, char *Destination);
  58. LONG ReadKey(struct Keys *);
  59. void WaitLMB(void);
  60. void WaitTime(WORD MicroSeconds);
  61.  
  62. /* JoyPorts */
  63.  
  64. void  InitJoyPorts(void);
  65. LONG ReadJoyPort(WORD PortName, WORD ReturnType);
  66.  
  67. /* Files */
  68.  
  69. struct File * OpenFile(char *Filename, LONG Flags);
  70. LONG ReadFile(struct File *, APTR Buffer, LONG Length);
  71. LONG WriteFile(struct File *, APTR Buffer, LONG Length);
  72. void CloseFile(struct File *);
  73. APTR SmartLoad(char *FileName, APTR Destination, LONG MemType);
  74. APTR QuickLoad(char *FileName, APTR Destination, LONG MemType);
  75. LONG SmartSave(char *FileName, APTR Source, APTR SrcLength);
  76.  
  77. APTR SmartUnpack(APTR Source, APTR Destination, LONG Password, LONG MemType);
  78.  
  79. /* Pictures */
  80.  
  81. APTR  GetPicInfo(APTR PicHeader, struct Picture *);
  82. LONG  UnpackPic(APTR Source, struct Picture *);
  83. struct Picture * LoadPic(struct Picture *);
  84. struct Picture * LoadPicTags(ULONG tag1Type, ...);
  85. struct Picture * LoadPicTagList(struct TagItem *);
  86. struct Picture * LoadPicFile(char *Filename, LONG Options);
  87. void  FreePic(struct Picture *);
  88. APTR  GetPicture(void);
  89.  
  90. void InitDestruct(void *DestructCode, APTR DestructStack);
  91. void SelfDestruct(void);
  92. void Armageddon(LONG Key);
  93. LONG FingerOfDeath(struct GMSTask *);
  94.  
  95. APTR  GetStructure(LONG ID);
  96. APTR  FreeStructure(APTR Structure);
  97.  
  98. /* Objects */
  99.  
  100. APTR  LoadObjectFile(char *Filename);
  101. APTR  GetObject(APTR ObjectBase, char *Name);
  102. APTR  GetObjectList(APTR ObjectBase, APTR);
  103. void  FreeObjectFile(APTR ObjectBase);
  104. APTR  GrabObjectList(APTR ObjectBase);
  105. APTR  CopyOjbect(APTR ObjectBase, char *Name);
  106.  
  107. void DebugMessage(LONG Type, char *Text);
  108. void ErrorMessage(LONG ErrorCode);
  109. void StepBack(void);
  110. LONG DebugActive(void);
  111. void DebugInactive(void);
  112. LONG Awaken(struct GMSTask *);
  113. void CopyStructure(APTR Source, APTR Destination);
  114.  
  115. /************************************************************************************
  116. ** Screens.GPI functions
  117. */
  118.  
  119. APTR  AllocVideoMem(LONG Size);
  120. APTR  GetScreen(void);
  121. struct GameScreen * AddScreen(APTR GameScreen);
  122. struct GameScreen * AddScreenTags(ULONG tag1Type, ...);
  123. struct GameScreen * AddScreenTagList(struct TagItem *);
  124. void  DeleteScreen(struct GameScreen *);
  125. void  ShowScreen(struct GameScreen *);
  126. APTR  HideScreen(struct GameScreen *);
  127. void  Switch(void);
  128. void  AutoSwitch(void);
  129. void  SwapBuffers(struct GameScreen *);
  130. void  WaitVBL(void);
  131. void  WaitRastLine(WORD LinePosition);
  132. void  RefreshScreen(struct GameScreen *);
  133. void  RemakeScreen(struct GameScreen *);
  134. void  MovePicture(struct GameScreen *);
  135. void  ResetPicture(struct GameScreen *);
  136.  
  137. /* Palette alteration functions */
  138.  
  139. void  UpdatePalette(struct GameScreen *);
  140. WORD PaletteMorph(struct GameScreen *, WORD FadeState, WORD Speed,
  141.  LONG StartColour, LONG AmtColours, APTR SrcPalette, APTR DestPalette);
  142. WORD PaletteToColour(struct GameScreen *, WORD FadeState, WORD Speed,
  143.  LONG StartColour, LONG AmtColours, APTR Palette, LONG RRGGBB);
  144. WORD ColourMorph(struct GameScreen *, WORD FadeState, WORD Speed,
  145.  LONG StartColour, LONG AmtColours, LONG SrcColour, LONG DestColour);
  146. WORD ColourToPalette(struct GameScreen *, WORD FadeState, WORD Speed,
  147.   LONG StartColour, LONG AmtColours, APTR Palette, LONG RRGGBB);
  148. void  ChangeColours(struct GameScreen *, WORD FadeState, APTR Colours,
  149.   WORD StartColour, WORD AmtColours);
  150. void  BlankColours(struct GameScreen *);
  151.  
  152. /* Rasterlist functions */
  153.  
  154. LONG InitRasterlist(struct GameScreen *);
  155. void  UpdateRasterlist(struct GameScreen *);
  156. void  UpdateRasterCommand(struct GameScreen *, APTR Command);
  157. void  UpdateRasterCommands(struct GameScreen *, APTR Command, WORD Amount);
  158. void  UpdateRasterLines(struct GameScreen *);
  159. void  RemoveRasterlist(struct GameScreen *);
  160. void  HideRasterlist(struct GameScreen *);
  161. void  ShowRasterlist(struct GameScreen *);
  162.  
  163. /* Sprite functions */
  164.  
  165. struct Sprite * InitSprite(struct GameScreen *, struct Sprite *);
  166. struct Sprite * InitSpriteTags(struct GameScreen *, ULONG tag1Type, ...);
  167. struct Sprite * InitSpriteTagList(struct GameScreen *, struct TagItem *);
  168.  
  169. void UpdateSprite(struct GameScreen *, struct Sprite *);
  170. void MoveSprite(struct GameScreen *, struct Sprite *);
  171. void HideSprite(struct GameScreen *, WORD SpriteNum);
  172. void UpdateSpriteList(APTR SpriteList);
  173. void HideSpriteList(APTR SpriteList);
  174. void RemoveAllSprites(void);
  175. void ReturnAllSprites(void);
  176. void FreeSprite(struct Sprite *);
  177.  
  178. void UpdateColour(struct GameScreen *, LONG Colour, LONG Value);
  179. void BlankOn(void);
  180. void BlankOff(void);
  181. LONG MoveToFront(struct GameScreen *);
  182. LONG MoveToBack(struct GameScreen *);
  183. LONG TakeDisplay(struct GameScreen *);
  184. struct GameScreen * ReturnDisplay(void);
  185.  
  186. void FreeVideoMem(APTR MemBlock);
  187. APTR GetSprite(void);
  188.  
  189. /************************************************************************************
  190. ** Blitter.GPI functions.
  191. */
  192.  
  193. APTR AllocBlitMem(LONG Size);
  194. APTR GetBob(void);
  195. APTR GetMBob(void);
  196. LONG AllocBlitter(void);
  197. void FreeBlitter(void);
  198. APTR InitBob(APTR Bitmap, APTR Bob);
  199. APTR InitBobTags(APTR Bitmap, ULONG tag1Type, ...);
  200. APTR InitBobTagList(APTR Bitmap, struct TagItem *);
  201. void FreeBob(APTR Bob);
  202. void DrawBob(APTR Bob);
  203. void DrawBobList(LONG *BobList[]);
  204. void ClearBob(APTR Bob);
  205. void DrawLine(struct Bitmap *, WORD StartX, WORD StartY, WORD EndX, WORD EndY,
  206.        LONG Colour);
  207. void DrawUCLine(struct Bitmap *, WORD StartX, WORD StartY, WORD EndX, WORD EndY,
  208.        LONG Colour);
  209.  
  210. void  CopyBuffer(struct GameScreen *, WORD SrcBuffer, WORD DestBuffer);
  211. void  ClearBitmap(struct Bitmap *);
  212. void  ClearArea(struct GameScreen *, WORD StartX, WORD StartY, WORD EndX, WORD EndY);
  213.  
  214. struct Restorelist * InitRestore(APTR Bitmap, LONG AmtBuffers, LONG Entries);
  215. void  FreeRestore(APTR Bitmap);
  216. void  ResetRestore(struct Bitmap *);
  217. void  Restore(struct Bitmap *);
  218. void  CleanUpRestore(struct Bitmap *);
  219.  
  220. LONG InitMap(struct GameScreen *, struct Map *);
  221. void  DrawMap(struct GameScreen *, struct Map *);
  222. void  DrawMapRow(struct GameScreen *, struct Map *);
  223. void  FreeMap(struct Map *);
  224. void  DrawMapTile(struct GameScreen *, struct Map *, WORD XCoord, WORD YCoord);
  225.  
  226. void  DrawPixel(struct Bitmap *, WORD XCoord, WORD YCoord, LONG Colour);
  227. void  DrawUCPixel(struct Bitmap *, WORD XCoord, WORD YCoord, LONG Colour);
  228. void  DrawPixelList(struct Bitmap *, struct PixelList *);
  229. void  DrawUCPixelList(struct Bitmap *, struct PixelList *);
  230. LONG ReadPixel(struct Bitmap *, WORD XCoord, WORD YCoord);
  231. void  ReadPixelList(struct Bitmap *, struct PixelLIst *);
  232.  
  233. void  FreeBlitMem(APTR MemBlock);
  234. void  SetBobDimensions(APTR Bob);
  235. LONG SetBobDrawMode(APTR Bob, LONG Attrib);
  236.  
  237. struct Bitmap * GetBitmap(void);
  238. LONG InitBitmap(struct Bitmap *);
  239. void  FreeBitmap(struct Bitmap *);
  240.  
  241. /************************************************************************************
  242. ** Sound.GPI functions
  243. */
  244.  
  245. LONG AllocAudio(void);
  246. void  FreeAudio(void);
  247. struct Sound * InitSound(APTR Sound);
  248. struct Sound * InitSoundTags(ULONG tag1Type, ...);
  249. struct Sound * InitSoundTagList(struct TagItem *);
  250. void  FreeSound(APTR Sound);
  251. WORD CheckChannel(WORD ChannelName);
  252.  
  253. void  PlaySound(APTR Sound);
  254. void  PlaySoundDAC1(APTR Sound);
  255. void  PlaySoundDAC2(APTR Sound);
  256. void  PlaySoundDAC3(APTR Sound);
  257. void  PlaySoundDAC4(APTR Sound);
  258. void  PlaySoundPri(APTR Sound);
  259. void  PlaySoundPriDAC1(APTR Sound);
  260. void  PlaySoundPriDAC2(APTR Sound);
  261. void  PlaySoundPriDAC3(APTR Sound);
  262. void  PlaySoundPriDAC4(APTR Sound);
  263.  
  264. void  SetVolume(WORD Channel, WORD Volume);
  265. void  FadeVolume(WORD Channel);
  266. void  StopSound(struct Sound *);
  267. void  StopChannel(WORD Channel);
  268.  
  269. APTR  AllocSoundMem(LONG Size);
  270. APTR  GetSound(void);
  271. void  FreeSoundMem(APTR Memblock);
  272.  
  273. #endif /* CLIB_GAMES_PROTOS_H */
  274.